package com.bw.services.properties.model

import android.util.Log
import com.bw.common.http.NetUtils.httpRequest
import com.bw.services.properties.entity.PropertiesEntity
import com.bw.services.properties.entity.PropertiesEntityItem
import com.bw.services.visit.VisitApiService
import javax.inject.Inject

class PropertiesRepo @Inject constructor(private val apiService: PropertiesService){
    suspend fun getProperties():List<PropertiesEntityItem>?{
       return  try {
           val result =httpRequest {apiService.getProperties()}
           if (result.code==200){
               Log.d("TAG", "getVisit: 成功")
               result.data
           }else{
               null
           }
       }catch (e:Exception){
           Log.d("TAG", "getVisit:${e.message}")
           null
       }
    }
}